import request from '@/utils/request';

export default {
  search(page, size, searchMap) {
    return request({
      url: `goods/list/search/${page}/${size}`,
      method: 'post',
      data: searchMap
    })
  },
  addForm(formName) {
    return request({
      url: '/goods',
      method: 'post',
      data: formName
    })
  },
  getById(id) {
    return request({
      url: `/goods/${id}`,
      method: 'get',
    })
  },
  edit(form) {
    return request({
      url: `/goods/${form.id}`,
      method: 'put',
      data: form
    })
  },
  delete(id) {
    return request ({
      url: `/goods/${id}`,
      method: 'delete'
    })
  }
}